From 6488296fc00b72f4028ebf631366cda1d2b8db6a Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 30 Jan 2002 00:08:41 +0000 Subject: [PATCH] Document that a size of (GtkIconSize)-1 means don't scale. Tue Jan 29 19:04:41 2002 Owen Taylor * gtk/gtkstyle.c (gtk_style_render_icon): Document that a size of (GtkIconSize)-1 means don't scale. * gtk/gtkstyle.c (gtk_default_render_icon): Obey the -1 convention. * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to gtk_style_render_icon() to make sure that we catch it obviously if the style's render function tries to scale. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-0 | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-2 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ gtk/gtkimage.c | 2 +- gtk/gtkstyle.c | 9 +++++---- 9 files changed, 97 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e7729798d0..1fd92a9cce 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Tue Jan 29 19:04:41 2002 Owen Taylor + + * gtk/gtkstyle.c (gtk_style_render_icon): Document that + a size of (GtkIconSize)-1 means don't scale. + + * gtk/gtkstyle.c (gtk_default_render_icon): Obey the + -1 convention. + + * gtk/gtkimage.c (gtk_image_expose): Pass in -1 to + gtk_style_render_icon() to make sure that we catch it + obviously if the style's render function tries to + scale. + Tue Jan 29 18:50:59 2002 Owen Taylor * gtk/gtkimage.c (gtk_image_expose): Optimize exposes of diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index fc72560745..280a8d7720 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -1400,7 +1400,7 @@ gtk_image_expose (GtkWidget *widget, gtk_widget_get_direction (widget), GTK_WIDGET_STATE (widget), /* arbitrary */ - GTK_ICON_SIZE_SMALL_TOOLBAR, + (GtkIconSize)-1, widget, "gtk-image"); diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index c680032a41..b430730171 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -1760,7 +1760,8 @@ gtk_style_real_set_background (GtkStyle *style, * @source: the #GtkIconSource specifying the icon to render * @direction: a text direction * @state: a state - * @size: the size to render the icon at + * @size: the size to render the icon at. A size of (GtkIconSize)-1 + * means render at the size of the source and don't scale. * @widget: the widget * @detail: a style detail * @returns: a newly-created #GdkPixbuf containing the rendered icon @@ -1905,10 +1906,10 @@ gtk_default_render_icon (GtkStyle *style, return NULL; } - /* If the size was wildcarded, then scale; otherwise, leave it - * alone. + /* If the size was wildcarded, and we're allowed to scale, then scale; otherwise, + * leave it alone. */ - if (gtk_icon_source_get_size_wildcarded (source)) + if (size != (GtkIconSize)-1 && gtk_icon_source_get_size_wildcarded (source)) scaled = scale_or_ref (base_pixbuf, width, height); else scaled = GDK_PIXBUF (g_object_ref (G_OBJECT (base_pixbuf))); -- 2.30.2